#include "threadpool.h"
#include "mythread.h"
#include <QDebug>

void ThreadPool::init(const int &num, const int &max)
{
    if(num > max)return;
    m_max = max;
    for(int i = 0;i < num;++i){
        MyThread* mth = new MyThread;
        connect(mth,SIGNAL(text(QString)),this,SLOT(getText(QString)));
        mth->id = i;
        mth->start();
    }
}

void ThreadPool::getText(const QString txt)
{
    qDebug() << txt;
}

ThreadPool::ThreadPool(QObject *parent) : QObject(parent)
{
    
}
